<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

  <link href="Styles/detail.css" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="Js/jquery.min.js" ></script>
  
  <script type="text/javascript" src="Js/index/index.js"></script>
  
  <!-- easyui -->
  <script type="text/javascript" src="Js/easyui/jquery.easyui.min.js"></script>
  <script type="text/javascript" src="Js/easyui/locale/easyui-lang-zh_CN.js"></script>
  <link rel="stylesheet" type="text/css" href="Js/easyui/themes/icon.css">
  <link id="themeLink" rel="stylesheet" type="text/css" href="Js/easyui/themes/default/easyui.css">
  
</head>

<body>
    <div class="main">
        <!--头部-->
        <div class="top">
            <!--left-->
            <div class="top_left">
                <div class="tu_1">
                    <img src="Images/4.png"/>
                </div>
                <div class="word_1">
                    <span><strong>Lmyau's</strong></span>
                    <span><strong>Blog</strong></span>
                </div>
            </div>

            <!--middle-->
            <div class="top_middle">
                <ul>
                    <li><a href="index">博客</a></li>
                    <li><a href="aboutme">关于我</a></li>
                    <li><a href="connect">和我联系</a></li>
                </ul>
            </div>
            <!--right-->
            <div class="top_right">
               <!--  <input type="text" name="name">
                <div></div> -->
                <form action="categoryname">
                	<input class="shuru" type="text" name="title">
	               <!--  <div></div> -->
	               <input class="sub" type="submit" value="  ">
                </form>
            </div>
        </div>
        <!--主体部分-->
        <div class="tail">
            <div class="tail_content">
                <!--主体左边部分-->
                <div class="tail_left">
                    <div class="type">
                        <span>博客分类</span>
                    </div>
                    <div class="type_content">
                       <ul>
                       	  <c:forEach items="${categoryList}" var="category">
                             <li><a href="category?categoryid=${category.id}">${category.name}</a></li>
	                      </c:forEach>
                       </ul>
                    </div>
                    <div class="type">
                        <span>关于博主</span>
                    </div>
                    <div class="author">
                        <div class="author_img">
                            <img src="Images/5.jpg">
                            <div class="common"><span>姓名：</span><span>${user.name}</span></div> 
                            <div class="common"><span>出生日期：</span><span><fmt:formatDate pattern="yyyy-MM-dd" value="${user.birthday}"/></span></div>
                            <div class="common"><span>星座：</span><span>${user.constellation}</span></div>
                            <div class="common"><span>现居城市：</span><span>${user.city}</span></div>
                            <div class="common"><span>爱好：</span><span>${user.hobby}</span></div>
                        </div>
                    </div>
                </div>
                <!--主体左边部分结束-->

                <!--主体右边部分-->
                <div class="tail_right">
                	
                	<div class="tail_main">
                		<div class="detail_title"><span><a href="detail?id=${blog.id }">${blog.title}</a></span></div>
                		<div class="detail_main">
                			<div class="detail_content"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                				${blog.content }
                			</div>
                		</div>
                		<div class="detail_category"><span>分类：</span><span><a href="category?categoryid=${blog.categoryid }">${blog.categoryName }</a></span></div>
                	</div>
                	
                	<div class="print"><span>下载文章</span></div>
                	
					<div class="preview">
						<span>上一篇：</span><span class="fontcolor previous"><a href="detail?id=${privId}">${privName}</a></span>
					</div>
					<div class="next">
						<span>下一篇：</span><span class="fontcolor nexts"><a href="detail?id=${nextId }">${nextName}</a></span>
					</div>
               </div>
                <!--主体右边部分结束-->
            </div>
        </div>
    	
    	
   		<div class="read_more">
    		<a href="javascript:void(0)">查看更多</a>
    	</div>
    	<div class="read_more"> </div>
  	   	<!-- 页脚 -->
   		<div class="footers">
    		<span>&copy; 2018 Lmyau's Blog 版权所有 网站备案号: 豫A111111111</span>
    	</div>
    	
    </div>

</body>

<script type="text/javascript">
	
	//若没有了，改变链接的href属性。
	//上一篇
	var target = $('.previous');
	
	if(target.text()=='没有了'){
		
		$('.previous a').attr("href","javascript:void(0)");
		
	}
	
	//下一篇
	var target2 = $('.nexts');
	
	if(target2.text()=='没有了'){
		
		$('.nexts a').attr("href","javascript:void(0)");
		
	}
	
	
	//打印
	
	$('.print').click(function(){
		var title = $('.detail_title a').text();
		
		var content = $('.detail_content').text();
		
		var link = $('.detail_title a').attr("href");
		
		
		//alert($('.detail_title a').attr("href"));
		//alert(title+",,,"+content);
		
	  	$.post("print",{title:title,content:content,link:link},function(data){
			
	 		if(data.status==0){
	 			$.messager.alert('提示','下载成功！pdf文档默认保存到d盘根目录中！'
	 			);
	 		}
			
		});  
	});
	
</script>

</html>